#ifndef __EDITORSCENE_H__
#define __EDITORSCENE_H__

#include <stdtype.h>
#include <standard/xml.h>
#include <bigimage/scene.h>
#include <mdxl/mdxparticlemanager.h>

class CFileWriter;
class CSceneObjectManager;
class CShadowSpace;
class CParticleMaterial;
class CLineHelperMaterial;
class CNavigationHelperMaterial;
class CPlaneHelperMaterial;
class CGameObjectMaterial;
class CEditorScene: public CScene{
public:
    CEditorScene();
    virtual ~CEditorScene();
    virtual bool32 Final();
    virtual void Update( int32 nDelta, float fDelta);
    virtual void Render(CTextureTarget* pTextureTarget, int32 nViewportWidth, int32 nViewportHeight);
    virtual void AddChild( CGameObject* pGameObject );
    virtual void RemoveChild( CGameObject* pGameObject );

    void AddTerrainRenderElement(CGameObject* pGameObject);
    void RemoveTerrainRenderElement(CGameObject* pGameObject);
    void AddNavigationHelperRenderElement(CGameObject* pGameObject);
    void RemoveNavigationHelperRenderElement(CGameObject* pGameObject);
    void AddLineHelperRenderElement(CGameObject* pGameObject);
    void RemoveLineHelperRenderElement(CGameObject* pGameObject);
    void AddPlaneHelperRenderElement(CGameObject* pGameObject);
    void RemovePlaneHelperRenderElement(CGameObject* pGameObject);
    void AddSceneObjectRenderElement(CGameObject* pGameObject);
    void RemoveSceneObjectRenderElement(CGameObject* pGameObject);

    CMDXParticleManager* GetParticleManager(){ return m_rParticleManager.GetEntityData(); }

public:
    bool32 m_bTerrainVisibled;
    bool32 m_bTerrainLineHelperVisibled;
    bool32 m_bSceneObjectVisibled;

private:
    CColor m_tLightColor;
    CColor m_tFogColor;
    float m_fFogNear;
    float m_fFogFar;

    Ref< CShadowSpace*> m_rShadowSpace;

    Ref < CMaterial* > m_rTerrainMaterial;
    Ref<CRenderElementManager*> m_rTerrainRenderElementManager;

    Ref< CNavigationHelperMaterial* > m_rNavigationHelperMaterial;
    Ref<CRenderElementManager*> m_rNavigationHelperRenderElementManager;

    Ref < CLineHelperMaterial* > m_rLineHelperMaterial;
    Ref<CRenderElementManager*> m_rLineHelperRenderElementManager;

    Ref< CPlaneHelperMaterial* > m_rPlaneHelperMaterial;
    Ref<CRenderElementManager*> m_rPlaneHelperRenderElementManager;

    CSceneObjectManager* m_pSceneObjectManager;
    Ref < CGameObjectMaterial* > m_rGameObjectMaterial;
    Ref<CRenderElementManager*> m_rGameObjectRenderElementManager;

    Ref < CParticleMaterial* > m_rParticleMaterial;
    Ref< CMDXParticleManager* > m_rParticleManager;



};

#endif

